How I resolved these issues:
- For icon and button couldn't at the same line:
I set up the icon's position as relative because "places an element relative to its current position without changing the layout around it" (from medium)
- For web extension is not working:
I delete the whole text with "< a >" hyperlink in HTML and replace it by "< button >". I decide to use sth like onclick="myFunction()"
However, this is not allowed in chrome apps and extensions. I find the solution through stackoverflow and find the solution - using the "id" instead of onclick.
Therefore, the HTML will look like
<button id="myButton">Click me</button>
Inside of javascript:
document.getElementById("myButton").addEventListener("click", myFunction);
function myFunction(){
console.log('asd');
}
- For "Refused to execute inline event handler because it violates the following Content Security Policy directive":
I wasted a super long time - a week - try to find solution online. Finally, I found a useful suggestion that tell me to add the "location.href" and "window.open" inside of function
So, I set up 2 id with 2 functions that link to Google Doc and Google sheet
Inside of each function, I put the hyperlink inside like
function myFunction(){
console.log("hyperlink");
location.href = "hyperlink";
window.open("hyperlink");
};
javascript page